package com.csw.shuanfa.SuanFa;

import java.util.ArrayList;
import java.util.List;

public class T3 {

    private static Object object;
    private static boolean aBoolean;

    public static void main(String[] args) {
        List<String> list1 = new ArrayList();
        List<String> list2 = new ArrayList();
        List resultList = new ArrayList();
        fuZhi(list2, (int) Math.pow(10, 5));
        fuZhi(list1, 3);
//        //  处理
//        biJiao(list1, list2, resultList);
//        //打印list
//        daYingList(resultList);

        aBoolean = list1.retainAll(list2);
        daYingList(list1);
    }

    private static void biJiao(List list1, List list2, List resultList) {
        if (list2.size() < list1.size()) {
            chuLi(list2, list1, resultList);
        } else {
            chuLi(list1, list2, resultList);
        }
    }

    private static void chuLi(List listSmall, List listBig, List resultList) {
        for (int i = 0; i < listSmall.size(); i++) {
            object = listSmall.get(i);
            if (listBig.contains(object)) {
                resultList.add(object);
            }
        }
    }

    private static void fuZhi(List list, int maxRound) {
        for (int i = 0; i < maxRound; i++) {
            list.add("aa" + i);
        }
    }

    private static void daYingList(List list) {
        for (int i = 0; i < list.size(); i++) {
            //list.get(i));
        }
    }
}
